const mongo = require("./db/user")();

mongo.init("mongodb://localhost:27017", "user", "info");

/*          添加用户          */
// mongo.addUser({nickname: "灿明", password: "272244064",age: "19",interest: ["游戏", '美食' ,"漫画"]})
//   .then(result => {console.log(result);},err => {console.log(err);});

/*          查找昵称          */
// mongo.findUser({'nickname':'陈'}).then(result=>{console.log(result);},err=>{console.log(err);})

/*          删除用户          */
// mongo.deleteUser({ nickname: "明" }).then(result => {console.log(result)}, err => {console.log(err)});

mongo.updateUserData({ nickname: "明" }, {$set:{'company':'嘻嘻'}}).then(result => {console.log(result)}, err => {console.log(err)});